Shores Algorithm